package com.itheima.leetcode.od.c.logicalsimulation;

import java.util.Arrays;
import java.util.Scanner;

/**
 * <h3>数字涂色</h3>
 */
public class DigitalColoring {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.nextLine());

        int[] arr = Arrays.stream(sc.nextLine().split(" "))
                .mapToInt(Integer::parseInt)
                .toArray();

        System.out.println(getResult(n, arr));
    }

    public static int getResult(int n, int[] arr) {
        Arrays.sort(arr);

        if (arr[0] == 1) {
            return 1;
        }

        boolean[] color = new boolean[n];
        int count = 0;

        for (int i = 0; i < n; i++) { // 组合
            if (color[i]) {
                continue;
            }

            color[i] = true;
            for (int j = i + 1; j < n; j++) {
                if (!color[j] && arr[j] % arr[i] == 0) {
                    color[j] = true;
                }
            }

            count++;
        }

        return count;
    }
}